home *** CD-ROM | disk | FTP | other *** search
/ VRML 2.0 Sourcebook (2nd Edition) / VRML 2.0 Sourcebook CD [md5 fed90f4f9c39d5a60d477058775c7e21].iso / book / win / ch24 / 24fig04.wrl < prev    next >
Text File  |  1996-09-23  |  2KB  |  77 lines

  1. #VRML V2.0 utf8
  2. # The VRML 2.0 Sourcebook
  3. # Copyright [1997] By
  4. # Andrea L. Ames, David R. Nadeau, and John L. Moreland
  5. Group {
  6.     children [
  7.     # Middle C (C4)
  8.         Transform {
  9.             children [
  10.                 DEF WhiteKey Shape {
  11.                     appearance Appearance {
  12.                         material Material { }
  13.                     }
  14.                     geometry Box { size 0.23 0.1 1.5 }
  15.                 },
  16.                 DEF C4 TouchSensor { },
  17.                 Sound {
  18.                     source DEF PitchC4 AudioClip {
  19.                         url "tone1.wav"
  20.                         pitch 1.0
  21.                     }
  22.                 }
  23.             ]
  24.         },
  25.     # C# above middle C (Cs4)
  26.         Transform { translation 0.125 0.1 -0.375
  27.             children [
  28.                 DEF BlackKey Shape {
  29.                     appearance Appearance {
  30.                         material Material {
  31.                             diffuseColor 0.4 0.4 0.4
  32.                         }
  33.                     }
  34.                     geometry Box { size 0.2 0.1 0.75 }
  35.                 },
  36.                 DEF Cs4 TouchSensor { }
  37.                 Sound {
  38.                     source DEF PitchCs4 AudioClip {
  39.                         url "tone1.wav"
  40.                         pitch 1.059
  41.                     }
  42.                 }
  43.             ]
  44.         },
  45.     # D above middle C (D4)
  46.         Transform { translation 0.25 0.0 0.0
  47.             children [
  48.                 USE WhiteKey,
  49.                 DEF D4 TouchSensor { }
  50.                 Sound {
  51.                     source DEF PitchD4 AudioClip {
  52.                         url "tone1.wav"
  53.                         pitch 1.122
  54.                     }
  55.                 }
  56.             ]
  57.         },
  58.     # D# above middle C (Ds4)
  59.         Transform { translation 0.375 0.1 -0.375
  60.             children [
  61.                 USE BlackKey,
  62.                 DEF Ds4 TouchSensor { }
  63.                 Sound {
  64.                     source DEF PitchDs4 AudioClip {
  65.                         url "tone1.wav"
  66.                         pitch 1.189
  67.                     }
  68.                 }
  69.             ]
  70.         }
  71.     ]
  72. }
  73. ROUTE C4.touchTime  TO PitchC4.set_startTime
  74. ROUTE Cs4.touchTime TO PitchCs4.set_startTime
  75. ROUTE D4.touchTime  TO PitchD4.set_startTime
  76. ROUTE Ds4.touchTime TO PitchDs4.set_startTime
  77.